package com.atguigu.gulimall.feign.order;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gulimall.order.entity.OrderInfo;
import com.atguigu.gulimall.order.vo.OrderConfirmVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author nicc
 * @version 1.0
 * @className OrderFeignClient
 * @date 2022-10-20 11:45
 */
@RequestMapping("/api/inner/order")
@FeignClient("service-order")
public interface OrderFeignClient {

    /**
     * 提交秒杀单
     * @param orderInfo
     * @return
     */
    @PostMapping("/seckillorder/submit")
    public Result<String> saveSeckillOrder(@RequestBody OrderInfo orderInfo);

    /**
     * 返回指定订单数据
     * @param orderId
     * @return
     */
    @GetMapping("/info/{orderId}")
    public Result<OrderInfo> getOrderInfoData(@PathVariable("orderId") Long orderId);

    /**
     * 获取订单确认页数据
     * @return
     */
    @GetMapping("/confirm/data")
    public Result<OrderConfirmVo> getOrderConfirmData();
}
